home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Text / Textension / Include / RulersRanges.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-21  |  2.3 KB  |  94 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        RulersRanges.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Essam Zaky
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>      1/4/94    EZ        clean up
  13.          <1>      1/4/94    EZ        first checked in
  14.  
  15. */
  16.  
  17. #ifndef _Rulers_
  18. #define _Rulers_
  19.  
  20. #ifndef _ToolBoxDump_
  21. #include "ToolBoxDump.h"
  22. #endif
  23.  
  24. #ifndef _TextensionCommon_
  25. #include "TextensionCommon.h"
  26. #endif
  27.  
  28. #ifndef _Array_
  29. #include "Array.h"
  30. #endif
  31.  
  32. #ifndef _ObjectsRanges_
  33. #include "ObjectsRanges.h"
  34. #endif
  35.  
  36. #ifndef _RulerObject_
  37. #include "RulerObject.h"
  38. #endif
  39. //***************************************************************************************************
  40.  
  41. class    CRulersRanges    :    public CObjectsRanges {
  42.     public:
  43.         CRulersRanges();
  44.         
  45.         void IRulersRanges(CArray* chars, CAttrObject* protoObj);
  46.         
  47.         //•Override
  48.         virtual void Free();
  49.         
  50.         virtual void FreeData(Boolean compact = true);
  51.         
  52.         virtual CAttrObject* Offset2Object(TOffset offset);
  53.         
  54.         virtual long UpdateRangeObjects(long startOffset, long len, const TAttrObjModifier* modifier);
  55.  
  56.         virtual CAttrObject* GetContinuousObj(long startOffset, long len);
  57.         //the returned value is the obj at startOffset and not realy the continuous, this is how word processors show the current ruler
  58.         
  59.         
  60.         #ifdef txtnDebug
  61.         virtual void CheckCoherence(long count);
  62.         #endif
  63.         
  64.         
  65.         //•own members
  66.         CRulerObject* GetNewRuler() const;
  67.         
  68.         void SetDefaultRuler(char rulerJust = 0);
  69.  
  70.         void CharRange2ParagRange(TOffset* startOffset, TOffset* endOffset) const;
  71.         //•uses text chars
  72.         
  73.         long GetReplaceExtraChars(long startOffset, long endOffset, CAttrObject** replaceObj);
  74.         //•uses text chars, to be called before replacing the text chars
  75.         
  76.         long ValidateRulerRange(long offset, long len);
  77.         /* to be called after an input operation by stream, use fChars (•should be called after updating the text chars).
  78.         returns the count of extra chars that are not in the range offset..offset+len and are changing ruler (should be formatted and redrawn)*/
  79.  
  80.     protected:
  81.     
  82.     private:
  83.         CArray* fChars;
  84.         CRulerObject* fPendingRuler;
  85.         
  86.         CRulerObject* GetPendingRuler(long offset, long len);
  87.         void InvalidatePendingRuler(long offset, long len);
  88.         
  89.         Boolean ValidateRuler(long rulerIndex);
  90. };
  91. //**************************************************************************************************
  92.  
  93. #endif
  94.